package util;

import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Properties;

/**
 * @author Administrator
 */
public class ConfigUtil {

    private ConfigUtil(){}

    public static Properties getConfig() throws Exception {
        Properties properties = new Properties();
        File file = new File((new File("src.")).getCanonicalPath() + "/config.properties");
        InputStream inputStream = new FileInputStream(file.getPath());
        //InputStream inputStream = ConfigUtil.class.getResourceAsStream("config.properties");
        properties.load(new InputStreamReader(inputStream, "utf-8"));
        inputStream.close();
        return properties;
    }
}
